<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('给驿站留言')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-leave-msg">
		<div class="col-md-12">
			<div class="form-group">
				<label class="col-sm-3 control-label">留言名称：</label>
				<div class="col-sm-9">
					<input type="text" id="createBy"name="createBy" class="form-control" placeholder="请输入名称">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">内容：</label>
				<div class="col-sm-9">
					<textarea rows="20" cols="100" type="text" id="msg" name="msg" class="form-control" placeholder="请输入内容"></textarea>
				</div>
			</div>
		</div>
	</form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
	function submitHandler() {
			leave();
	}
	function leave() {

		var createBy = $('#createBy').val();
		var msg = $('#msg').val();
		var formData = new FormData();
		formData.append('createBy', createBy);
		formData.append('msg', msg);
		$.ajax({
			processData: false,
			contentType: false,
			cache : false,
			type : "POST",
			url : ctx + "user/leaveMsg/leave",
			data :formData,
			async : false,
			error : function(request) {
				$.modal.alertError("系统错误");
			},
			success : function(data) {
				$.modal.alertSuccess("留言成功，工作人员会尽快回复");
			}
		});
	}
</script>
</body>
</html>
